import { View } from '@tarojs/components';
import { AtButton } from 'taro-ui';
import './index.scss';

export default function ({ noCart = false, onAddCart = () => {}, onBuy = () => {} }) {
  return (
    <View className="bottom-btns">
      {!noCart && (
        <AtButton className="secondary" onClick={onAddCart}>
          加入购物车
        </AtButton>
      )}
      <AtButton type="primary" className={noCart ? 'no-cart' : ''} onClick={onBuy}>
        立即购买
      </AtButton>
    </View>
  );
}
